//
//  VIPSignalingJSON.m
//  TTProduct
//
//  Created by My mac on 2018/8/22.
//  Copyright © 2018年 TTProduct. All rights reserved.
//

#import "VIPSignalingJSON.h"
#import "VIPSignalingModel.h"
#import "VIPPCH.h"

@implementation VIPSignalingJSON

+ (NSString *)JSONWithSignaling:(VIPSignalingModel *)signalingModel {
    return [self signalingDataToMessage: signalingModel];
}

+ (NSString *)signalingDataToMessage:(VIPSignalingModel *)data {
    NSError *parseError = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:data.mj_keyValues options:NSJSONWritingPrettyPrinted error:&parseError];
    
    
    if ((jsonData == nil || [jsonData isKindOfClass:[NSNull class]])) { return @""; }
    
    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}

@end
